package com.my.demos.consumer;

import com.my.demos.config.ConfirmConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.io.UnsupportedEncodingException;

/**
 * @author zhupanlin
 * @version 1.0
 * @description: 
 *      接收消息
 * @date 2023/12/1 19:01
 */

@Slf4j
@Component
public class Consumer {
    
    @RabbitListener(queues = ConfirmConfig.CONFIRM_QUEUE_NAME)
    public void receiveConfirmMessage(Message message) throws Exception {
        String msg = new String(message.getBody(), "UTF-8");
        log.info("接收到的队列confirm.queue消息:{}", msg);
    }
    
}
